package com.neu.his.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.neu.his.entity.request.nonDrugManage.NonDrugInsertParams;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@TableName("non_drug")
@Data
public class NonDrug extends Base {
    private String nonDrugName;
    private BigDecimal nonDrugPrice;
    private String nonDrugUnit;
    private String nonDrugCode;
    private int nonDrugNum;

    public void copy(NonDrugInsertParams nonDrugInsertParams){
        this.nonDrugName=nonDrugInsertParams.getNonDrugName();
        this.nonDrugPrice=nonDrugInsertParams.getNonDrugPrice();
        this.nonDrugCode=nonDrugInsertParams.getNonDrugCode();
        this.nonDrugUnit=nonDrugInsertParams.getNonDrugUnit();
    }

    @TableField(exist = false)
    private List<NonDrugDisturb> nonDrugDisturbList;

    @Override
    public String toString(){
        return JSON.toJSONString(this);
    }
}
